Skip to content

Conversation

cmdrclueless
Copy link
Contributor

@cmdrclueless cmdrclueless commented Jul 10, 2019

As part of RFC4514 section 2.4, it's permissible to prefix some characters with the backslash (\) symbol instead of using the standard format of \xx where xx is the hexadecimal code for the character in question. This was exposed when a group in Active Directory (AD) was created with a # symbol.

Consider the DN CN=#Supers,DC=foo,DC=bar,DC=com. AD sends this as CN=\#Supers,DC=foo,DC=bar,DC=com, which is an alternative format according to the spec. However the # symbol is hex code 23. This mean the standardized form via the spec should result in CN=\23Supers,DC=foo,DC=bar,DC=com. Unfortunately during testing AD will return the record, if and only if, the alternative format is used.

The relevant section of the RFC for this change follows

Each octet of the character to be escaped is replaced by a backslash
and two hex digits, which form a single octet in the code of the
character. Alternatively, if and only if the character to be escaped
is one of

 ' ', '"', '#', '+', ',', ';', '<', '=', '>', or '\'
 (U+0020, U+0022, U+0023, U+002B, U+002C, U+003B,
  U+003C, U+003D, U+003E, U+005C, respectively)

it can be prefixed by a backslash ('' U+005C).

@mtodd
Copy link
Member

mtodd commented Nov 18, 2019

Hi @cmdrclueless, thanks for the contribution! Would you be open to taking a pass at implementing tests to demonstrate the expected behavior?

@cmdrclueless
Copy link
Contributor Author

cmdrclueless commented Nov 19, 2019 via email

@HarlemSquirrel
Copy link
Member

@cmdrclueless do you have a few moments to attempt to write some tests for this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants